Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ntuple] move RColumnElement out of anonymous namespace #16907

Closed

Conversation

silverweed
Copy link
Contributor

to avoid spurious warnings by some compilers, such as:

‘void {anonymous}::RColumnElementQuantized<T>::SetValueRange(double, double) [with T = double]’ declared ‘static’ but never defined [-Wunused-function]

Copy link
Contributor

@jblomer jblomer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we take them out of anonymous, shouldn't we put the definitions instead in ROOT::(Experimental)::Internal

@@ -313,8 +313,7 @@ inline void CastZigzagSplitUnpack(void *destination, const void *source, std::si
}
} // namespace

// anonymous namespace because these definitions are not meant to be exported.
namespace {
namespace ROOT::Experimental::Internal {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, it is quite unusual to have an anonymous namespace in a header file. I guess it would result in any symbol/function defined in there to be actually declared/defined multiple times (one per source file that include this header) with different actual names

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably also review line 57 of this file and

bindings/pyroot/cppyy/CPyCppyy/src/DeclareConverters.h:namespace {
bindings/pyroot/cppyy/CPyCppyy/src/DeclareExecutors.h:namespace {
bindings/pyroot/cppyy/cppyy/test/stltypes.h:namespace {
io/io/test/io_test.hxx:namespace {
math/mathcore/src/MixMaxEngineImpl.h:namespace { 
tree/ntuple/v7/test/SimpleCollectionProxy.hxx:namespace {

Copy link

github-actions bot commented Nov 12, 2024

Test Results

    19 files      19 suites   3d 22h 48m 20s ⏱️
 2 665 tests  2 665 ✅ 0 💤 0 ❌
48 742 runs  48 742 ✅ 0 💤 0 ❌

Results for commit c826c8b.

♻️ This comment has been updated with latest results.

Those functions need to be defined static to avoid violating ODR in
the ntuple_endian, that includes the file while changing the endianness,
ending up with a different definition of those functions.
@hahnjo
Copy link
Member

hahnjo commented Nov 13, 2024

#16923 is an alternative that reduces the includes of RColumnElement.hxx to avoid the compiler warnings.

@silverweed silverweed closed this Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants